<?php

class DbBase
{
    protected $properties = array();
    public function __construct( array $props = array() )
    {
        $this->properties = $props;
    }
    
    public function __call( $name, $args )
    {
        switch( $name )
	    {
		    case 'set':
			    $this->properties[ $args[0] ] = $args[1];
			    break;

		    case 'get':
			    if( isset( $this->properties[ $args[0] ] ) )
			    {
				    return $this->properties[ $args[0] ];
			    }
			    else 
			    {
				    throw new Exception( "Property \'$args[0]\' does not exist", 0 );
			    }
			
			    break;
		
		    default:
			    if( isset( $this->properties[ $name ] ) )
			    {
				    return $this->properties[$name];
			    }
			
			    throw new Exception( 'No properties with name: \''.$name.'\' found.' );
	    }
    }
}
